<template>
	<z-paging ref="paging" :auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false"
		v-model="dataList" @query="queryList" :default-page-size='pageSizeCount' :default-page-no='0'>
		<!-- <template>
			<view class="">
				
			</view>
		</template> -->

		<view class="flex-row" style="flex-wrap: wrap; padding: 10px;">
			<view @click="pushDetailsPage(index)" v-for="(item,index) in dataList" :key="index">
				<AlbumCell :dataModel="item"></AlbumCell>
			</view>
		</view>

	</z-paging>
</template>

<script>
	import ZSSwiper from '../../components/zs-swiper/zs-swiper.vue'
	import AlbumCell from '../album-page/album-cell.vue'

	export default {
		components: {
			ZSSwiper,
			AlbumCell
		},
		data() {
			return {
				dataList: [],
				typeList:[],
				pageSizeCount:20,
			}
		},
		
		methods: {
			change(index) {
				this.typeValue = this.typeList[index];
				console.log('点击==',this.typeValue)
				 this.$refs.paging.reload()
			},
		
			queryList(pageNo, pageSize) {
			this.getData(pageNo);
			},
			getData(pageNo){
				this.$uniCloudApi.get_album_list('1','',pageNo,this.pageSizeCount).then((res) => {
					this.$refs.paging.complete(res);
				}).catch(err => {
					this.$refs.paging.complete([]);
					this.errStr = err.toString();
					uni.showToast({
						title: err.toString(),
						icon: 'none'
					})
				})
			},
			pushDetailsPage(index){
				var model = this.dataList[index]
				uni.navigateTo({
					url: '../album-detils-page/album-detils-page?albumNmae=' + model.albumName
				});
			}
		}
	}
</script>

<style lang="scss">
	.topView{
		background-color: white;
		border-radius: 15px;
		padding: 15px;
	}
</style>